﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MyCoreLib.Automation.Data.SqlClient.Model
{
    public class StoredProcedureSelectorInfo
    {
        public readonly string Name;
        public readonly string Schema;
        public readonly string FullName;

        public readonly ReadOnlyCollection<string> ResultSetContractNames;

        public StoredProcedureSelectorInfo(IOutput output, IStoredProcedureSelector storedProcedureSelector)
        {
            var genericDbObject = new GenericDbObject(storedProcedureSelector);
            Name = genericDbObject.Name;
            Schema = genericDbObject.Schema;
            FullName = genericDbObject.FullName;

            ResultSetContractNames = new ReadOnlyCollection<string>(storedProcedureSelector.QueryResultContractNames.ToList());

        }
    }
}
